package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.PageCommonParamBo;
import com.cskaoyan.bean.entity.Brand;
import com.cskaoyan.bean.vo.BasePageData;
import com.cskaoyan.bean.vo.BaseParam;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.BrandService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <h2> 小程序端 Brand Controller</h2>
 * @Author: GaoJia
 * @Date: 2021/10/21 15:07
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Resource
    BrandService brandService;

    /**
     * <h2> 品牌列表 </h2>
     */
    @RequestMapping("list")
    public BaseRespVo list(PageCommonParamBo pageParam){
        BasePageData<Brand> brands = brandService.list(pageParam);
        return BaseRespVo.ok(brands);
    }

    /**
     * <h2> 品牌详情 </h2>
     */
    @RequestMapping("detail")
    public BaseRespVo detail(Integer id){

        // wx/brand/detail?id=1046040
        Brand brand = brandService.detail(id);
        return BaseRespVo.ok(brand);
    }

}
